﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Tododoo.Lib
{
    public class ViewModelBase : INotifyPropertyChanged
    {
        public virtual string Title { get { return "View model base"; } }

        protected void OnPropertyChanged(string propertyName)
        {
            var evt = this.PropertyChanged;
            if (evt != null) evt(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void Close()
        {
            var evt = this.RequestClose;
            if (evt != null) evt(this, EventArgs.Empty);
        }

        public event EventHandler RequestClose;
    }
}
